#!/bin/sh

FQDN=`hostname -f`

if [ "x$FQDN" != "xhelio.me.umn.edu" -a "x$FQDN" != "xstinson.me.umn.edu" ]; then
    echo "$0 must be run on helio.me.umn.edu"
    exit
fi

BASEDIR=$HOME/Projects/SimGear

# Update the file last changed time stamps
$BASEDIR/admin/stampwrapper.sh 

SOURCE=~/Projects/SimGear/www/*

# Backup simgear server www
DEST=curt@baron.flightgear.org:/var/www/simgear

# Master simgear server www
DEST=curt@seneca.flightgear.org:/var/www/simgear

# MEnet
DEST=curt@ssh.me.umn.edu:public-html/simgear

# SourceForge
DEST=curt@shell.sourceforge.net:/home/groups/s/si/simgear/htdocs

for DEST in \
    curt@baron.flightgear.org:/var/www/simgear \
    curt@seneca.flightgear.org:/var/www/simgear \
    curt@ssh.me.umn.edu:public-html/simgear \
    curt@shell.sourceforge.net:/home/groups/s/si/simgear/htdocs \
    ; do

    echo mirroring from $SOURCE to $DEST

    rsync --verbose --archive --delete --cvs-exclude \
            --rsh ssh \
            --exclude fgfs.css \
            $SOURCE $DEST 2>&1
done
